//
//  BaseViewModel.m
//  YiCuiMiaoZhang
//
//  Created by Sings on 2019/3/20.
//  Copyright © 2018 益萃网络科技（中国）有限公司. All rights reserved.
//

#import "BaseViewModel.h"

@implementation BaseViewModel

- (id)mutableCopyWithZone:(NSZone *)zone {
    return [self getCopyObjc];
}
- (id)copyWithZone:(NSZone *)zone {
    return [self getCopyObjc];
}
- (instancetype)getCopyObjc {
    BaseViewModel *baseViewModel     = [[BaseViewModel alloc] init];
    baseViewModel.navServices        = self.navServices;
    baseViewModel.netWorkingServices = self.netWorkingServices;
    baseViewModel.codeModel          = self.codeModel;
    return baseViewModel;
}
- (NavServices *)navServices {
    return [[MZRouting sharedInstance] navServices];
}

- (NetWorkingServices *)netWorkingServices {
    return [[MZRouting sharedInstance] netWorkingServices];
}

- (BZCodeModel *)codeModel {
    if (_codeModel == nil) { _codeModel = [[BZCodeModel alloc] init]; }
    return _codeModel;
}

- (void)refreshFun {
    if (self.refresh) { self.refresh(); }
}

@end
